package com.ruoyi.system.service.aid.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.aid.AidTransportMapper;
import com.ruoyi.system.domain.aid.AidTransport;
import com.ruoyi.system.service.aid.IAidTransportService;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;

/**
 * 物流运输Service业务层处理
 * 
 * @author ruoyi
 */
@Service
public class AidTransportServiceImpl implements IAidTransportService {
    @Autowired
    private AidTransportMapper transportMapper;

    /**
     * 查询物流运输列表
     */
    @Override
    public List<AidTransport> selectTransportList(AidTransport transport) {
        return transportMapper.selectAidTransportList(transport);
    }

    /**
     * 查询物流运输详细
     */
    @Override
    public AidTransport selectTransportById(Long transportId) {
        return transportMapper.selectAidTransportById(transportId);
    }

    /**
     * 新增物流运输
     */
    @Override
    public int insertTransport(AidTransport transport) {
        transport.setCreateTime(DateUtils.getNowDate());
        transport.setCreateBy(SecurityUtils.getUsername());
        return transportMapper.insertAidTransport(transport);
    }

    /**
     * 修改物流运输
     */
    @Override
    public int updateTransport(AidTransport transport) {
        transport.setUpdateTime(DateUtils.getNowDate());
        transport.setUpdateBy(SecurityUtils.getUsername());
        return transportMapper.updateAidTransport(transport);
    }

    /**
     * 批量删除物流运输
     */
    @Override
    public int deleteTransportByIds(Long[] transportIds) {
        return transportMapper.deleteAidTransportByIds(transportIds);
    }

    /**
     * 删除物流运输信息
     */
    @Override
    public int deleteTransportById(Long transportId) {
        return transportMapper.deleteAidTransportById(transportId);
    }

    /**
     * 根据承运人ID查询运输列表
     */
    @Override
    public List<AidTransport> selectTransportByCarrierId(Long carrierId) {
        return transportMapper.selectTransportByCarrierId(carrierId);
    }

    /**
     * 根据物资分配ID查询运输列表
     */
    @Override
    public List<AidTransport> selectTransportByAllocationId(Long allocationId) {
        return transportMapper.selectTransportByAllocationId(allocationId);
    }

    /**
     * 根据运输状态查询运输列表
     */
    @Override
    public List<AidTransport> selectTransportByStatus(String status) {
        return transportMapper.selectTransportByStatus(status);
    }
} 